package Io;

import java.io.File;

public class FileMain
{
	public static void main(String[] args)
	{
		/*路径分隔符：;*/
		System.out.println("====");
		String pathSptarator = File.pathSeparator;
		System.out.println(pathSptarator);
		char pathSptaratorChar = File.pathSeparatorChar;
		System.out.println(pathSptaratorChar);
		/*名称分隔符*/
		System.out.println(File.separator);
		System.out.println(File.separatorChar);
		File file_01 = new File("D:\\a");
		File file_02 = new File("a.txt");
		File file_03 = new File("D:/a/","a.txt");
		File file_04 = new File(file_01,"b.txt");
		System.out.println("===toString===-->"+file_01);
		System.out.println("getpath->"+file_02.getAbsolutePath());
		/*获取最后一级的文件名字*/
		System.out.println("getName-> "+ file_01.getName());
		/*判断路径或者文件是否存在*/
		System.out.println("exists()->"+file_02.exists());
		//获取父级的目录(字符串)
		System.out.println("getparent->"+file_03.getParent());
		System.out.println("getparentFile->"+file_03.getParentFile());
		//isFile判断是不是文件
		System.out.println("isFile->"+file_03.isFile());
		//isDirectory判断是不是文件夹
		System.out.println("isDirectory->"+file_01.isDirectory());
		//isHidden判断是否隐藏
		System.out.println("isHidden->"+file_03.isHidden());
		//canread判断是否可读
		System.out.println("canread->"+file_03.canRead());
		//canwrite判断是否可写
		System.out.println("canwrite->"+file_03.canWrite());
		//canExecute判断是否可执行   只有liuex里面有
		System.out.println("canExecut->"+file_03.canExecute());
		//length()判断大小
		System.out.println("leagth->"+file_03.length());
		
	}
}
